﻿using System;
using System.Collections.Generic;
using System.Windows.Threading;
using System.Collections.ObjectModel;
using System.ComponentModel;

namespace SilverlightApp.data
{
    public class PairInfo : INotifyPropertyChanged
    {
        public string Name { set; get; }
        public DateTime Time { get; set; }
        private double _value;

        public double Value
        {
            get
            {
                return _value;
            }
            set
            {
                _value = value;
                OnPropertyChanged("Value");
            }
        }

        #region INotifyPropertyChanged 成员

        /// <summary>
        /// Fires the PropertyChanged event.
        /// </summary>
        /// <param name="propertyName">Property that changed.</param>
        private void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler.Invoke(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion
    }

}
